package task3.source;

import java.beans.EventSetDescriptor;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;
import task3.util.InputListener;

public class BSourceBeanInfo
  extends SimpleBeanInfo
{
  public PropertyDescriptor[] getPropertyDescriptors()
  {
    try
    {
      Class<BSource> cls = BSource.class;
      PropertyDescriptor file = new PropertyDescriptor("fileName", cls);
      file.setPropertyEditorClass(FileEditor.class);
      return new PropertyDescriptor[] { file };
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
    return null;
  }
  
  public EventSetDescriptor[] getEventSetDescriptors()
  {
    try
    {
      Class<BSource> c = BSource.class;
      String es = "input";
      Class<InputListener> lc = InputListener.class;
      String[] names = { "inputChanged" };
      String al = "addListener";
      String rl = "removeListener";
      EventSetDescriptor esd1 = new EventSetDescriptor(c, es, lc, names, al, rl);
      return new EventSetDescriptor[] { esd1 };
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
    return null;
  }
}
